#include<stdio.h>
#include<string.h>
int main(void){
	char s[200000];
	char arr[26];
	int i,j,n,sum=0;
	scanf("%s",&s);
	n=strlen(s);
	for(i=0;i<26;i++){
		arr[i]='a'+i;
	}
	for(i=0;i<n;i++){
		if(s[i+1]==s[i]+1 || s[i+1]==s[i] || s[i]==s[i+1]+1 || s[i-1]==s[i]-1 || s[i]==s[i-1]-1 ||s[i-1]==s[i] ||s[i]==s[i-1]+1){
			for(j=0;j<26;j++){
				if(s[i]==arr[j]){
					sum+=j+1;
				}
				
			}
		}
	}
	printf("%d",sum);
	return 0;
}

